

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import javax.ejb.EJB;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

import be.ipl.diavoloz.dao.DemonsDao;
import be.ipl.diavoloz.modele.Couleur;
import be.ipl.diavoloz.modele.Demons;
import be.ipl.diavoloz.usecases.GestionConnexion;
import be.ipl.diavoloz.usecases.GestionInscription;

public class DemonsTest {
	@EJB
	DemonsDao demonDao;

	private Demons d = new Demons("a", Couleur.BLEU);
	
	@Test
	public void testDemons() {
		Demons d1 = new Demons("a", Couleur.BLEU);
		assertTrue(d.equals(d1));
	}

	@Test
	public void testIsEstPris() {
		assertFalse(d.isEstPris());
	}

	@Test
	public void testSetEstPris() {
		d.setEstPris(true);
		assertTrue(d.isEstPris());
	}

	@Test
	public void testGetNom() {
		assertEquals("a", d.getNom());
	}

	@Test
	public void testGetCouleur() {
		assertEquals(Couleur.BLEU, d.getCouleur());
	}
	
	@AfterClass
	public void setAfterClass() {
		demonDao.supprimerTable();
	}

}
